import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '/schedule',
          name: 'schedule',
          component: () => import('../components/schedule/ScheduleView.vue')
        },
        {
          path: '/station',
          name: 'station',
          component: () => import('../components/station/StationView.vue')
        },
        {
          path: '/trainline',
          name: 'trainline',
          component: () => import('../components/trainline/TrainlineView.vue')
        },
        {
          path: '/tabs',
          name: 'tabs',
          component: () => import('../components/tabs/MainTabs.vue'),
          children: [
            {
              path: '/tabs/a',
              name: 'aaa',
              component: () => import('../components/tabs/TabsAAA.vue')
            },
            {
              path: '/tabs/b',
              name: 'bbb',
              component: () => import('../components/tabs/TabsBBB.vue')
            }
          ]
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/test',
      name: 'test',
      component: () => import('../components/tabs/TestView.vue')
    },
    {
      path: '/mytree',
      name: 'test',
      component: () => import('../components/tabs/MyTree.vue')
    },
    {
      path: '/web',
      name: 'web',
      component: () => import('../components/web/WebView.vue')
    }
  ]
})

export default router
